BUG Fix versioned
Versioned is not writing Version to _version tables for subclasses of Version dataobjects which have their own DB fields
- Fix disjoint of ID / RecordID (which should be the same)
- Fix calculation of new record version
- Fix use of empty vs !isset to check for existing version

Conflicts:
	model/Versioned.php
	tests/model/VersionedTest.php

Cherry picked from commit c140459ac624738630ac8bec6a665fa3040e2e54
Merge pull request #3666 from Copperis/versioned-0-version-write-fix

Versioned now creates a new version if the version is 0