Added javadoc and straightened up the licensing