Changes to make build independent of version of astropy

`_last_generated_version` is very much an internal detail that shouldn't be used.