[WIP] Refactoring in Alerts section - foundation for Alerts testing

This is intended to make awful things less awful and generally prepare (and then subsequently make) for the Alerts testing.

*Work in progress*