first iteration of a code cleanup/refactor... still messy
I made a final decision on file names and module layout
added some command line useage docs and smoke tested them