Refactor into separate files
Use python logging
Comments and code formatting
Save events for zones/partitions defined in the config file only

This has the added advantage that the web API doesn't have to
transmit data for unused zones. In turn, the API client processes
less data.