WIP fix Naive Bayes coefficient stuff

This fixes #2237 and #2240.

Not yet MRG and 0.14-rc because I'm not sure if there's a good way to preserve backward compat and some more refactoring needs to be done.