added javadocs, some package restructuring, some general tweaks and changes