Big speedup for square distance matrices derived from raw scores in ff format

* >20x in my tests
* previously we were doing at least 2x more work, but it was taking much
  longer than 2x. Partially explained by diagonal (which took 1/3 of time)
  but main effect must have been due to slow read of reverse scores
Tests to ensure optimisations for square distance matrices don't break things

* test by fetching scores/distances in square and non-square form
bump version to 0.3.1