Refactoring: parsing has its own namespace

I split all the parse logic into its own namespace. The core namespace
is now limited to handling command-line arguments and directing the run
at a more abstract level.