Fix all jshint warnings except unused vars in orphaned code (will handle in later commits)
Removed orphaned method referencing non-existing var
Remove / rearrange refactoring leftover
Merge pull request #913 from amr/fix_jshint_warnings

Fix jshint warnings