Cleanup and test

Adds code cleanup, and tests. Added a sample family to run with.