Improve performance of application for large teams

This commit fixes a lot of sql queries to db for for groups and projects
with big amount of members.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Make MR tabs look like tabs :)

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Prevent exceptions for methods like ProjectTeam#developer? if no membership exists

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'improve-mr-tabs' into 'master'

Improve MR tabs UI/UX

![Screenshot 2014-06-04 12.29.19](https://dev.gitlab.org/uploads/dzaporozhets/gitlabhq/b75785b28f/Screenshot_2014-06-04_12.29.19.png)
Merge branch 'perforemance-improve' into 'master'

Performance improve

Fixes #1315.
For group with 500 users it reduce amount of sql queries from 500 to 20.
It reduces page load ~ 3 times or even more. For larger group it will be even more difference