lib template enhancements

If interested, some enhancements to the template:

-global define jshint
-wrap and define global scope to suppress jshint complaints about this
-pass global scope to factory

I disable jscs, so this might not pass that.