Overhaul lexer to use a reader and custom peek and next functions