wrap the whole thing in a closure, keep 'use strict' out of the global scope.
Style change - use named functions.
adjust indentation
Allow late definition for functions. (http://www.jshint.com/docs/options/#latedef)
Merge pull request #170 from okonomiyaki3000/named_functions

Refactor to use Named functions, add use strict.