added depth search for type
merge db
added search classes methods to relations
added safe type search to class Relation
merge relationships