WIP: Middlewares

This implements pipelining / middlewares on the model level, so events can be fired before and after Resources are interacted with.  This is distinct from the "change notifications", which notify subscribers of relevant updates.