sanitize perf related code

Basically trying to pass jslint/jshint checks. Otherwise IDE
highlights errors and makes code unreadable. Disabling validation
doesn't seem to be a good idea.
Merge pull request #12 from pavel-paulau/lint

sanitize perf related code