Sets attributes on an Javascript object and fires change events ala Backbone.