Initial checkin; script tidied up and made fit for the world