Reorder two functions.

Put SquaredDistance and Distance next to eachother.
Add more geometry tests.
Add comments to exported types.
Add 2d geometry tests.