Add parser.js

Includes a few scrapped together testcases. By all means, try to break
it.