A little cleanup and reorg (mostly of the parsing code) and comments.
Reorg, exporting a public API, comments