Clean up lexer.py a bit