Nonparametric tests of independence based on interpoint distances