Javadoc support, refactoring

Signed-off-by: Sunstrike <sunstrike@azurenode.net>