STM: move out a couple of submodules

These modules are not as reusable as one may want them to be, but
moving them out simplifies a little STM.
Stateid: export a Set module
STM: perspective (tell the scheduler what the user sees)