Fix cmd_visual and move some tests into io/