Add more api to binarization code

This code will later be refactored to be a set of reusable components that
will be used in pure IJ2 plugins that replace the four methods of mask
creation in IJ1.