fixes for depth-based loci partitioning, very basic unit tests, refactoring