Normalize keywords and flatten metadata