Make sharding explicit.
Use more automagic SWIG wrapping.  Update to explicit sharding.

Hopefully this will reduce the amount of work needed for future backend
changes.  Longterm should just have a specific python backend, but that
deserves more thought.