add middleware support in backbone.coffee