Implement keys

Fixes #2