Tidy up some code
Implement downloading a new release with better version checking