Envelope autocomplete items to workaround shallow copy

* jQuery autocomplete seems to do a shallow copy on items passed into
  the autocomplete-popup methods.  This means when the item is selected,
  the object passed to the `select` handler looks like a model instance
  in every way *except* prototype chain / instanceof value.  Wrapping
  the objects in a temporary envelope avoids the issue.
Add `context` attribute to all client-side models

* Also adds a `Context` model
* Avoids warning messages due to `context` stubs not being models or
  modelizable; make `Context` a first-class client-side object (needed
  for following commits)
Make stubs singletons

* Maintain a 1-1 mapping between stubs and model instances
* Trigger and consume `stub_destroyed` events to remove items from
  attribute lists without requiring a `refresh()`
* `JoinModel` instances now listen on endpoints to trigger `destroyed`
  when an endpoint instance is destroyed -- this removes mappings
  related to those server-side-deleted join instances, causing the
  mapping framework to update correctly.
Merge pull request #1291 from reciprocity/feature/make-stubs-singletons

Make stubs singletons