Change calling convention: all crops done at once

To save the crop location, we need the crop code to return a single set
of values, even if there are multiple square thumbnail sizes. This
change means that all the cropping is done by a single call to the
(renamed) function create_crops(), which returns the percentage crop
positions.
correct logic if getimagesize() fails
rejig to use crop percentages, save in db

Several changes here: make create_crops() take a specific
crop_percentage argument, rather than an unnecessary array of options.

The css crop position calculations are moved into crop_image(), which
is only called for a user-initiated crop, where the data_object_id is
known, and we assume that a height and width have already been stored
in the image_sizes table. The other time that the option crop_pct can
be set is when reharvesting a known data_object with a custom user
crop.

Other changes are to make the logic & names clearer in
create_content_thumbnails(), and comment more clearly about CS cropping
arrangements. Also allow for a non-square region to be selected (made
square later).
Properly express as %ages, validate from 0...100
Reuse crop info when force_redownloading
Oops: add data_object_id to grab_file call if necc
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().
Some syntax corrections

Also remove my inserted function and define it in-situ
Revert to calling create_crop for each size

New way not needed now that we save the crop sizes higher up
Correct variable name change form last commit
Simple variable correction