Fix: factory should be called only one time depending on the environment

Small fix for browserify. In some cases old code caused problems with building.
Also I've added closure variable $ that is taken from Backbone.$

I'm sorry but I can't understand how to pull your changes and merge with them.
It would be great if you can update nom as well (:

Sincerely,
Anthony