Add docblock documentation and formatting

Nothing crazy here. Just formatted the code a bit and added some DocBlock comments for documenting purposes.  Also, @phillipbrown, I added some notes for things that should be looked at.  I hope that's okay.  I can make the changes soon.