Reworked compiler post pass to be generic for all flat record models.