First impl of bag-of-features classifier