New parser

Includes (hopefully) more robust handling of the syntax, especially nesting and the hierarchy of blocks/elements. Also parsing of standard and simple tables (albeit without colspan or rowspan capability) and line blocks. Probably a few other things I've forgotten about too.