Tweaks to bernoulli mixture model and added nn2d.

- nn2d.pyx (nn_resample2d) is for doing nearest-neighbor resampling of a 2d ndarray.