Remove entries from deleted projects asynchronously

So far, removing the events belonging to non-existing projects was done
synchronously while processing a query request. This caused the queries
to be slower than expected.

Delete events asynchronously using a queue so that this operation can be
offloaded from the query path. Also, listen to onProjectDeleted event so
that every time a project is deleted, the entries are removed from the
database.

Change-Id: If457ef7667f3a3292b000e46fa0d499e345c92d4
7 files changed