Optimize and refactor crop

The `cropTop` function was generalized to handle two dimensions simultaneously (and now is named `cropHalf`), so the image can be cropped in fewer passes.