Fixed some JSHint problems

e.g. tabs to spaces, white space around if, for, while and opening function braces, added 0 to .5 etc. for clarity and added braces around some single line if, else and for body to improve readability and make it less likely to make mistakes if changing that code in future. Also corrected some spelling mistakes in metadata.

The diff doesn't look very good as I replaced tabs with 4 spaces (if you still prefer tabs I can put them back and try the PR again). A "git diff -w" works fairly well or side-by-side diff.

Thanks for the applet!