Rearrange some parts of magit.el

Semantics over ease of archeology. Also see 7c922a29ea86e794ded0bdec576e62fd4b6329ea.