Adding javadocs and licence headers.