Refactored some largely independent components out into their own packages.