Rewrote build task

Instead of making a big chain of callbacks, each of the steps in the
build process has a seperate function