Rewrite version parsing

I ran into a couple of cases where the version update failed, so I decided to try to rewrite the version parsing logic from scratch.  It ended up being a lot more difficult than anticipated because of all the different cases, but I think it's at a point now where it's better than the old parsing.

I kept all the original tests, and added several new ones which test the parsing more directly.  I only had to make minor changes to two of the existing osgi conversion tests where previously an invalid OSGi version was created, and the new parser produces a valid version.