Cleaned up code, refactored names, reorganized groups, and added an appledoc target