Rewrote version from scratch to support both osgi and maven syntax.