Code cleanup of max_distance code; experiments with docs; trans. option.

There is a trans => 1 option in new.

I am trying to work out what documentation format is least insane.