Cleaned up code and added comments

Removed unnecessary functions and code. Added comments so I won't want
to kill myself later. Added updates to changelog.  Switched all tabs to
4 spaces. Would have been awful otherwise. Think of the children.