Added more tests, fixed bugs, and extended the parser to cover more parts of the grammar