Crop and extend line methods in Line class

This is resubmission of pull request #439.
In Line class added cropToImageEdges method and corrected extendToImageEdges method.
Also fixed bug in bresenham_line method in ImageClass, where were incorrect cropping of lines.