Cleaned up code, added comments, regenerated documentation via JavaDoc.