Moved Reactor to separate files, added Shelf.react

Moved Reactor code around and added traits to make it slightly reusable.
Shelf.react executes a transaction that just adds a new reaction and
returns it.