Various updates in the REST server.
Adds a cache for events to avoid flickers.
gulpfile rewritten.