Cleanup parsing / dumping code. Add a few new elements.