Add Apache License and some javadoc.