Reworked tests to be run with cmake.

I also changed some code in the parser to pass tests