Adding amd and commonjs support

I added this so I could use routerfilter with browserify.  I've tested it as such and it works great.  I haven't tested it with AMD or globals, but I borrowed this technique from what I've seen done elsewhere.