Preserve ordering of fields when converting object to dict