Shift split selection into Agent::split_test(...) and cleanup/refactor other code;