Implement the lexer

Since it's pretty much my first non-trivial piece of Scala code, more than one person may want to review this...

Fixes #19.
We maybe should avoid recursion here, as long streaks of whitespace chars will make the stack overflow. But that's not urgent.