Changed the structure of the lib so that it is more sutible for a server
process. Changed the lightcollection so it uses the device id as key and
added an event channel for external updates.