Hint errors in test's fixed + simplified test code

function within loop extracted, + I have tried to make it more readable so shifted the code a bit.
hope you don't mind. It can be even more simplified.

So far no time to make jshint part of the make 
but will have a look.

Two more questions: why not including Crockfords code from git as npm ? 
or just putting it into reps folder which btw you have already ? 

Any specific reasons to keep this so independent on others ?

Thanx

P.S. no idea why Commits on Dec 04, 2014 are part of the pull request again, I have merged your upstream.