Initial working implementation.

Have not implemented the codec or concurrency features.