Clean up code, add javadoc to new classes
Fixes from code inspection