Bug fixes in parsing and misc stuff

Just in case this project is not actually dead, I'm proposing some bug fixes.
Notice also that there are several more test cases from the current SpiderMonkey test suite that break now.