Rewrite redpys so that flushing cleans the DB also.