A naive bayes classifer in javascript