Implement key deserialization.

Closes #11.