Fix OMERO version number generation

- Fix a bug in the server upgrade page where the previous version number was
calculated to 5.-1
- Correctly parse the version numbers using semver.org conventions
- Define list of previous minor versions for each major version
- Do not import the re module globally