Fixed bugs creating large numbers of generations

* After gen 20 an older revision would be purged, moving the Revision
  objects around and invalidating a pointer.
* The revid::expand method in CBForest had two severe bugs,  handling
  revs with generations bigger than 58, another bigger than 127.

Fixes #458
Fixed a warning during validation