Add license headers, fix comments