Code review and overhaul of the new revision system. Needs extended testing!