move token parser to its own object, add some parsing for if tags