Rewrite `script/build` and `script/version` in Go

A cross platform build script is needed to build `hub`. Instead of
writing different shell scripts for *nix and Windows, writing
everything in Go is a viable approach.