Further work on #20, alerts are now stored in the db to ensure the same alert isn't sent twice