Refactor manage-projects for readability

This changes absolutely no functionality - it's merely extracting parts
of the really long function into subfunctions. It should make further
refactoring of sequencing and error conditions easier to reason about.

Change-Id: I288a03f631faa1b4596e3fd5d5e1613ff2525b6e
1 file changed