some misc adapter bug fixes
added some handy new features to session

regset: specify a set of registers to pass to the
  callback function. this is more elegant than doing
  a lookup for each one explicitly in the callback
  function.

regstate: specify a set of register changes to make
  after the callback completes, setting each register
  specified in the dictionary to the value given.