1 add importance sampling for p-value computation. 2 add unit tests.