Give names to most manually assigned functions in the .js files, in form "var x = function()" -> "function x()" so that error stack traces and profiling stack traces are more informative and do not contain anonymous functions.
Merge pull request #1735 from juj/name_js_functions

Name js functions.