Cache team memberships

This was accidentally removed in 8023a53.