Refactor riak_test related code