fix test failing node0.8. trying to eliminate timing issues.
add jshinting and solve problems