fixes and improvements

基本上是根据 JSHint 修正一些错误，避免 hoisted variables，同时针对 V8 optimised function 特性调整函数参数的使用方式。

```
{
  "curly": true,
  "eqeqeq": false,
  "eqnull": true,
  "esnext": true,
  "forin": true,
  "indent": 2,
  "latedef": "nofunc",
  "newcap": true,
  "noarg": true,
  "noempty": true,
  "nonbsp": true,
  "quotmark": "single",
  "undef": true,
  "unused": true,
  "trailing": true,

  "asi": true,
  "eqnull": true,
  "expr": true,
  "laxcomma": true,

  "browser": true,
  "devel": true,
  "jquery": true,
  "node": true,
  "nonstandard": true
}
```