Applied greenido's wordCount fix. Moved new Random() out of document constructor.

Merges in greenido's fix + Seth's comments about that fix.
Also fixed issue #5, now only one random object is created for the app instead of for every new document.

mem