Move test cleanup into cleanup functions