Wrapping up work toward #86.

All tests pass, all examples are working.

TODO: docs.