Fixed an NPE indentified in BZ#1015084
Added new helper methods and new structures to hold a Version and RevNumber.
Fixed a bug where version wasn't being constructed properly.