speed up distance()

  - use BigInt method calls rather than overloading.
  - make fewer calls to badd().
  - access the k hash through one less level of indirection.
  - use implicit $_ where possible.