Subcommand refactor

These changes make it easier to write sub-subcommands for deployment and test running.