refactored tests; added service for ngrams; added switch for importing ngrams