Refactor Riak API.

Will help with #8 and #15