Moving link resolver to function
adding autoupdater to script. Will fetch latest version from github

Assumes permissions are ok and that `curl` and `tempfile` is available