added a good portion of the repl, fixed some parsing bugs, and tweaked error handling