Add javadoc for some major classes

Signed-off-by: plysan <plysab@gmail.com>
Remove trailing whitespaces and organize imports

Signed-off-by: plysan <plysab@gmail.com>