Implement new masking API

This PR is the implementation of #177.  I also moved some data preparation functions, like `interpolate_masked_data` to `photutils.utils`.