Many optimizations, Added java dock comments, Other fixes and additions