Parser now takes tree pointer argument

...and allocates some memory for the tree but never removes
it. Don't worry, I'll handle this in a moment.
Parser frees tree on error, main when no error.
Changed a bunch of functions to be static

I don't really want to leak them out of their translation
units, I guess. This way is better.