Reorganized build to get ready for writing a plugin loader.