Moved command handling into the 'core' module...

... and clean up some things, most noticably adding --version to the
argparse stuff, and making importing a module reload all the module's
parent packages with imp.reload().