Shared code for Backbone client/server