Exposing previous event in the cache and fixing memory implementation

The SmartThingsMemory implementation wasn't properly returning the
previous event the way the Database implementation was.
Formalized the event cacheId