Many rearrangements of file structure.  Added sort functions.  Starting to add tests.