Minimum image convention distances and displacement vectors

 cc @kyleabeauchamp @leeping

This is a bit of a refactor of geometry.distance as well.