fix bad function declaration

The function declarations were not on a global scope, but inside an if block, which is not allowed in strict mode, causing the compacted version of iD to fail loading.

The bug was introduced by me in #1805, sorry!