Parser tests

@fmmoret finished the parser unit tests. Good luck making them all pass. I haven't double-checked the code, so there are probably some bugs in the tests.