Added basic test suite, fixed some bugs in superficie estimation