Move common build stuff into it's own script.