Move functions out of the global scope. Fix a number of JSLint issues
Merge branch 'panuhorsmalahti-master'
convert back to tabs