Added REPL support, still needs some polishing