Fixed user removal from team and associated projects.

Added tests for adding and removing team members from associated projects.

Previously, when removing a user from a team, the user was not properly removed from associated projects. Reason was that the other_teams array was not flat, so when "empty" it actually looked like this: [[]].