Use sg dev_id in external interface to persistence layer, instead
of passing the (gateway_id, gateway_device_id) tuple and looking
it up each time. Every caller already knows, so why look it up,
and simplifying the calling convention will simplify future things.
Show event history for areas and lists of devices.

This is somewhat of a hack job; needs cleanup.
Substantial cleanup of device event history; move the string
formatting code to webif/demo.py and make it nicer.

persistence.get_recent_events is still pretty hacky internally
but the external interface is better now.