add deployBefore and deployAfter events. Closes #509

I suggested two new events for deploy operations:

- `deployBefore`
- `deployAfter`

I figured out how to code this feature, so here's my PR.