resolved mode not defined error

Fixing issue #27, and resolved a few jslint errors in thememanager.js