(#17) - don't store the full key in memory

Again, rebased on top of the two other PRs for my own convenience.