elaborate underscore initialization so that it works seamlessly on CommonJS, as well as in the browser
(cherry picked from commit a82a01ebfc545c727a5df5cb78b1d01351c4707d)