setup: better version handling

* Replicates version handling from Flask-Registry. (closes #9)

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
WRT copyright header, I'll soon issue a PR harmonising this across the repository.