fixes #11: generate parser using PEG.js; fixes #7; fixes #9

Kills 400 lines of manual parsing code with <100 lines of clean PEG grammar. Also fixes a few parsing bugs. I've removed the tokenisation-related tests since they're no longer applicable. Fixes #11. Fixes #7. Fixes #9.