Standalone version of Backbone's extend method