Code cleanup and directory structure changes

Put some organization in to the code structure to make it easier to
expand.