Fixing Autocrop class.  Adding unit tests.