hsic bugfix and refactoring test statistic framework