Automatic updates

This sorts out downloading of new updates. Not yet tested on windows.