Remove underscore as a dependency

This removes underscore as a dependency (in the main lib and in tests), and replaces the few methods it was using with tiny shims. Should work back to IE6 or 7, something like that. (Without the shims, it would work in only IE9+.)