Implement a key extractor.

Closes #7.