Implemented a REPL, made some minor changes