remove unused variables and enforce in jshint

fixes GH-2209