Add some tests for the parser.

* Test parser (assuming lexer is functional)
* Fix some parser bugs detected during testing
* Improve parser testability by introducing ast node equality
* Tests for ast equality