Add setup script

@rhattersley - could you cast an eye over this an make any suggestions if anything looks obviously wrong?
(I've tested it three times on a live version with no persistance) - will do another test once you've merged it.