Fix up version parsing code.

Now with working tests!

Signed-off-by: Wayne <wayne@puppetlabs.com>
Clean up semver string parsing.

Signed-off-by: Wayne <wayne@puppetlabs.com>