Remove history fields permanently and clean up empty reference and referenceType fields.