The OP asked for a lib for this, so I am just throwing it here.
I created infra functions which will intercept the actions and add meta-data to each action. (following FSA)
You can use this easily to create multiple containers without them affecting each other.