Feature/self reference check

currently PR #21 has been mixed into this, as this requires the dependency check code.