tests fixes
detect circular references in omit
refactoring + unit tests