Implement BCD.halve

 - improved BCD.toString.
 - added a helper function maxIndex to indicate the index limit
   that beta begins at at the start of halve