Tests passing

Added missing pieces and modified to work in our instance. First go at all tests passing.