Moving REPL code to Scotch.repl function.