Use own jshint configuration
Various javascript spacing fixes
Move declaration before function usage
Use consistent indentation
Relax some js checking
fix spacing