Implemented the key consumer

This is basically working. If we get a front end implementation, it
might be passable.