Moved prebuild commands into their own script

The command supplied to "build" is not actually run in a shell, so you have
to bundle your pre-build commands into a script.