Rewriting underscore.js based off the annotated source code (for learning purposes): http://underscorejs.org/docs/underscore.html