Initial changes to the test

Re-factored code.  Created initial tests, but they still need to be
refined.  Did not implement any of the new functionality.