Move testing stuff to testutil

testutil will be used by delayd-bench