CRM-17772 refactor main export processing function
This is a first refactor on the exportComponents function with the goal being to
a) provide a (small) start on getting testing going
b) move some of the php level processing out of the main ->fetch loop. Since this is iterated once per row it has
a significant impact on large exports. When doing profiling I noticed that the munge function was taking
quite a bit of time. I was investigating a reported increased slowness on upgrade & that had been introduced since the previous version and
the iteration happens has to help. Although I still had to leave some true old uglinesses & introduced some new ones I think
this is on the right track - ie. in general we should make the array match the fields in the
query unless there is good reaon for extra handling. This conclusion was also the driver for the test I added.
Don't even ask about that relationship block! But if we got rid of that we could structure as 'dao_query_field_name' => .