A middleware pattern implementation for Backbone