Attempt at reorganising

This is probably how I would do this. I got a SSL verification failed error when I tried to run it though.

It's probably easier to do a local checkout and read the source rather than reading the diff online.