Refactored active contour algorithm into own module