Restructured packages, generated javadoc, cleaned up code, added comments