Beef up / refactor zk adapter for testing

I rebased and touched up the code in #36. 
Yay, @fujin!