Quick refactor to simplify API and Tests
Added function support to the parser.