TFIDF Performance Improvments

Adding an IDF caching mechanism which reduces tfidfs time exponentially in most cases, also updated unit tests to include some untested functions.