Show a rebase button in the UI when needed
The rebase button shows in two situations:
- the PR can be merged via a merge commit (merge status: MERGE)
- the project enforces fast-forward merge and needs to be rebased
(merge status: NEEDSREBASE)
A lot of the churn after that is to compensate for the use of toggleClass,
since it both adds and removes, we need to explicitly remove all the
class it could possibly have added and add the ones that were there before
on all the different elements touched.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>