Fixed behavior of lexer

- Grouped keywords using `reversed` dictionary
- Fixed ambiguity bug caused by order of processing