refactored and broke naive bayes, started on clustering

I guess I've avoided unit testing for long enough