CRM-13067 - preliminary code tidy up

This PR does not change functionality but adds a test on the import function and tidies up areas of code readability.

Even after this some import fields are handled in up to 5 places - the functions import, summary, the api v2 formatter function, the api3 layer and the BAO::create function. 

Obviously I'm not going to tackle all the code duplication but this helps me get a handle on how changing the BAO might affect the import & creates t base for tests that alter it.