create module to define some functions to implement invariants (side-effect free asserts) in my code.
Using node collection and edge collection classes. Tests passing.