WIP: Initial re-organization for parsing support.

Pulled out everything not related to parsing.