Start refactoring code toward pluggable installers

Still needs to be extracted entirely, but it provides the start.