Fix standalone REPL read-time errors and *1 on tab completion

This fixes #145, as well as a bug were empty input lines caused `*1` to be set to `""`, and a bug where tab-completing caused `*1` to be set to the tab completion results.  I've also added some tests.