use previous crop info when caching image obj
Save image width & height in image_sizes table
Brief comment about where the row is created
When deleting data object, remove from image_sizes too
Move DB checking code out of DataObj into ContentManager
Put DB saving logic into separate functions
Add test case
Correct syntax so script runs
Correct faulty logic in grab_file

Currently $temp_file_path is checked for deletion even if it has been
returned as NULL from download_temp_file_and_assign_extension()
Massive rewrite to use hard links.

This also rationalises lots of the logic in a number of functions, but
particularly grab_file().