added safe clean method to delete non datasource records from the database
added missing accessor unit tests