Remove dead code.
Adding more PHP Doc comments.
More comments, removing dead code, fixing small bugs.