Move parse_reference to its own file

+ change its signature
Rename "lexer" to "parser"

and move rules from lexer_* to rules_*