WKT lexer

As I found myself some spare time and enthusiasm, I tried to write a lexer to replace the regex-based parsing of WKT strings (see also #2172). Here is the result. Please let me know whether this is anywhere near the concepts that have been conceived.
I'll give it a try later on. I don't expect too much out of it either.