Lot of JavaDoc improvements for the basic API-s. Some random smaller code cleanup.