refactor the build system

In case this format works better than Phabricator...