RPM version/release encoding algorithm

The code looks different than in the deep dive. I simplified the steps by doing the subsegment splitting (1alpha -> 1.alpha) at the start and then acting on each segment after that. I added the leading zero and exception handling on the off chance we get a >99 character version.

I was tempted to leave encode() as:
return '.'.join(map(_encode_subsegment, reduce(_split_subsegments, field).split('.')))

I opted for a more readable separation instead. :)