Distribution-Free Tests of Independence with Applications to Testing More Structures