Php parser

This is a work-in-progress towards fixing #195. Commits are still a bit messy, tests are still failing, code isn't completely cleaned up, but hopefully it can serve for some preliminary review or discussion. You have been warned ;-)
Oh, I just answered my question.