WIP #36: Added tests. Rewrote much relation-stuff in Sqldataaccessobjecthelper to pass the tests.