Index functionality split apart

Restructured code to better separate the logic.  Alerts will now be able
to be individually scheduled (elasticsearch-lag defaults to 10s). All
modules support initialisation and configuration.