Change function defs to variable defs in block scope.

Function definitions in blocks cause chrome to throw syntax error in
strict mode.