Class.refactor=function(original,refactors){Object.each(refactors,function(item,name){var origin=original.prototype[name];origin=(origin&&origin.$origin)||origin||function(){};original.implement(name,(typeof item=="function")?function(){var old=this.previous;this.previous=origin;var value=item.apply(this,arguments);this.previous=old;return value}:item)});return original};