Add unittest of utils.crop
Changed crop functionality slightly, inspired by asechrest's unittest.