Documentation

Added documentation to all missing functions and classes.  Added appropriate inline comments where necessary.  Removed used code.