Whole load of functionality.

Should be close to being ready to test. Needs a few other bits:
- Cleanup of temporary cache files
- Copy source files to a specific location?