Write general case of prior orientation finding

Cleanup - Remove some old scripts.
Rewrite "CheckParent" in "findUniqueParent"