test_replay: Add a license and reorganise the import statements