Fix jshint errors and run jshint from travis, fixes #146.
Some functions need to be simplified; for now added jshint maxcomplexity override.