Large code cleanup.

Added documentation, fixed grow up button not working, reduced renderer
overhead, removed unnecessary casts, cleaned up imports, removed unused
local and private variables, removed overriding fields, protected
against potential NPEs as identified by Eclipse, and fixed few possible
resource leaks.