Changes on task IITE-450.

Used checkstyle to fix all the style problems of the code, made some of
the inner classes nested and added javadoc where it was missing.