Added Javadoc.
Code reorganization in packages.