New implementation of centeredPatch

Now works with cv::Mat and cv::Mat_ equally well and provides a generic
interface that can provide additional compile time flags like bounds
checking and reference counting.