Functional tests for key reading/writing. Closes #20.