Improved design.
Fixed a few bugs.
Java doc.
Fixed a few bugs.
Java doc generated.