Javascript String underscorize()
underscorize()
String.prototype.underscorize = function() { return this.replace(/([A-Z])/g, function($1) { return "_" + $1.toLowerCase(); }).replace(/^_/g, ""); };