Add license headers and some minor documentation