Fixed conditional declaration of functions; passed in window elm to aid in minification.
Merge pull request #2 from timneill/master

Minor fixes