Move BagOfWords class to a more logical location and rename it