Implement a function to transform and clean a dataset in Python.
Write clean_dataset(records) for a list of dictionaries containing id, name, email, and age. Trim string fields, lowercase emails, convert valid numeric age strings to integers, discard records with missing or invalid required values, and keep only the first valid record for each normalized ID. Return a new list containing dictionaries with the keys id, name, email, and age.
def clean_dataset(records):