Backported encode_with; started on associations