factored unused canopy functions out of tfidf.py, closes #81