Use a single regular expression instead of a for loop.

I think using a single regular expression test instead of checking each word individually makes sense.. The regular expression only compiled once and for each change of the word list (which should be only once).

I also added tests for partial word matches and use require to load the badwords list (the json of which I also simplified).