update parser and grammar for single-declarations-followed-by-semicolons

I've left the old REPLPhrase and parse functions intact (to not break
tests, and since they may be independently interesting).

Here I extend the grammar with a REPLTop that takes a single declaration
(or expression). The repl_fun implementation uses parse_top instead of
parse.