Finish refactoring stuff into its own packages.