Code cleanup and de-"clever"ification for mustache_helper.js

* consistent spacing "if (", ") {", "function ("
* explicit return statements, esp. for "!f()" at the end of a function
* a && b -> if (a) b

Also simplified and separated the "firstexist" and "firstnonempty" helpers from a can.each loop, so IDEs could pick up their definitions.

Commented several helpers.

Only style, no functional changes.
Ensure one-line ifs have braces when necessary
Merge pull request #2063 from reciprocity/clode-cleanup-dandv

Code cleanup and de-"clever"ification for mustache_helper.js