move REPL out of thread into new UserInputHandler object