Introduce GhciMonad and generalize types of functions in GHCi.UI