moving some code around.  changing how 'active tabs' works.

we get a list of active tabs before checking all tabs for decay, rather
than marking tabs as active in the onActivated callback.  this helps us
avoid writing to the array of tabs while they are being read in other
async callbacks.