Fixes and tests for Perl 6 dist indexing

Finally I was able to run tests, so the chance that it actually works now is pretty high.