Added Common.js Support and underscore dependency

The factory function was using underscore without requiring it. That wouldn't work with commonjs and AMD.