windowstats refactor / cleanup
just a few stylistic changes

jshint is much happier now :)