Introduce strategies, collection events, and simplify batch scheme.

* Move decode_offsets() into iterators.py, where it's actually used.

* Move add_index() to top-level free function, in preparation for store
  metadata becoming a publicly modifiable, documented thing. Change
  Store.__getitem__ to return indices too; now indices live in the same
  namespace as collections, in preparation for cross-collection indices.

* Move remaining index implementation out of Collection class and into
  Index class, hook it up to Collection via events (currently
  hardwired).

* Split Collection implementation out into BasicStrategy and
  BatchStrategy. BasicStrategy does nothing except encode keys and pass
  all operations directly through to the store, and implements iteration
  using RangeIterator. Shortly it can be used for at least the metadata
  collection, and also for stores that suck as iteration (i.e. LevelDB).

* Make Collection call into the strategy based on what events are
  registered. If an index exists, or any other listener is watching for
  after_delete(), after_replace(), or after_create(), then use more
  expensive "Strategy.pop()" and "Strategy.replace()" operations,
  instead of "Strategy.put()" etc. This lets collections without an
  index defined take advantage of stores that don't suck as write-only
  loads (i.e. LevelDB).

* Remove transactionless API use from LmdbEngine. Now operations will
  fail unless using an object returned by begin().

* Batch strategy no longer supports compression of individual records.
  This could be re-added later, maybe. In the meantime it saves one
  string slice just to get rid of the packer prefix in the usual case of
  accessing a non-batch single record.

* Batch strategy no logner supports multiple compression schemes on the
  same Collection. One compressor is always used when creating a batch
  record, configured at collection creation time.

* Fix LmdbEngine tests to deal with returning buffers instead of strings
  now.