Fixes unminified build in firefox

Fixes issue: #116.

Changes: I moved the use of ready and completed to after they are defined.  This shouldn't be necessary, but makes the unminified version work in firefox.