JS declaration hoisting + scope = argh