Slight tidy: don't specify address space.
A better way of getting/using register_t.

Thanks to David for a useful discussion on this.
Oops: return value comes last.

I moved the return value to the end of instrumentation functions some time ago; that change never made it here.
Don't add non-variables to the tesla_key.
Put the mask at the end of tesla_key.
Drop a debug line.
Define tesla_instance_active().

There were several places where we were checking for active-ness in ad hoc (and sometimes different) ways; centralise this logic into tesla_instance_active().
Split up tesla_instance_get().

This function was actually doing several different things in slightly-hard-to-understand ways; split it into several function, each with a single clear purposes.