Add ability to run build on test

I've added the ability to run the build on test as well as deploy and tidied a few bits up that I came across.

Open for discussion.
@davemackintosh @knownasilya I made it archive through Git in order to respect any gitignores in the repository. By using tar directly you bypass anything that may have been gitignored, thus unnecessary engorging the archive in such circumstances.