Simplify parser code

Add token parser which optionally parses whitespace around a token.