Fix for non-amd environments

Adding a check for module to make it work in a plain old browser environment w/o module loader.