Implement a key constructor.

Closes #13.