Various version handling improvements

* Update version documentation
* Extract nominal-version from source by default
* Move globals to function
* Error handling if version does not match expectations