Lexer now returns an error if anything goes wrong

For now, the only error is if the input text is not valid UTF-8.

Tests pass

Fixes #17