Use the encoding if specified for tfidf.addFileSync

Fixes a bug where encoding was being ignored (always set to UTF-8)
Uses the more common "utf8" when referring to the encoding in node
Adds a check that the encoding specified is actually a valid one
Adds tests for the aforementioned
Fix the idf cache test

Test was mistakenly an "if" statement instead of a jasmine "it"
Index parameter was incorrect on the addFileSync calls
Syntax cleanup

Removed some trailing whitespace and a few stray hard tabs
Added in some missing semicolons for consistency
Add backwards compatibility for Buffer.isEncoding

Node 0.8 and older did not support the method. Unit tests still target 0.8.*. I am not a
huge fan of messing with core library prototypes so did not do this as a true "polyfill".
Merge pull request #181 from nategood/tfidf-encoding

Tfidf.addFileSync Encoding Fixes and Enhancements