Refactored Foundry to be more classical/hookable via events