Split classes up. Updated trimSubparts.

Some syntax errors still here from the merging.