In test suite, factory->group->create() should return an id, not an object

For better parity with other factories

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7050 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
When deleting an activity item, clear its metadata cache

Because of the way that the cache groups are structured, there is no simple
way to figure out which cache keys should be dropped upon deletion. Our
solution is to scan through all the keys in the 'bp' group to determine the
relevant ones. It's not particularly elegant, but this kind of cache-busting
will happen rarely (namely, when an activity item is deleted) so the overhead
is negligible.

Fixes #4804

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7051 cdf35c40-ae34-48e0-9cc9-0c9da1808c22