Refactor packages. Add Javadocs.