Add license headers, javadocs, and explain functionality