Improved javadoc

Should not be merged yet. There are a few todo's that need to be resolved.