entitlement: iteration on EventsStreamBuilder speedup optimizations

Explain the magic and add tests for eventsStreamBuilder.buildForAccount. Even though
all tests were passing, I still went ahead and updated buildForAccount to do the same
magic as buildForEntitlement. I didn't manage to write a failing test scenario for it
but it seems required.

This also fixes an NPE with standalone subscriptions.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
entitlement: optimize DefaultSubscriptionApi

Go through the getSubscriptionBundlesForAccountId API (which is
behind /1.0/kb/accounts/ACCOUNT_ID/bundles) and optimize the various
layers to limit the amount of DAO calls.

1.0 call timings for an account with 35 bundles and 67 subscriptions:

* Before changes: 8m40s
* After changes: 6.50s at startup, 4.20s after caches are warm

Since this call should be fast, change most APIs in DefaultSubscriptionApi
to always build all subscriptions for a given account first, and then do
further filtering in memory (per bundle, etc.). This simplifies the amount
of codepaths to optimize.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>