client, repl: better "error" handling

Properly catches the `SyntaxError`s in most of the browsers now.
Could probably use some improvement but this is a good start...