Refactorings and "javadoc" command

Made some refactorings and started work on a "javadoc" command.