Code cleanup and dependency upgrades

Code cleanup, optimized the imports and some java-doc fixes.

Updated some internal dependencies.
        log4j 1.2.16 -> 1.2.17
        hsqldb 2.2.4 -> 2.2.9