Cut almost 100 lines out of the header by condensing functions.  Updated test cases.