Moved re-factored build script into dev branch.