Internal refactor to master cmd

First-pass breakup of logical components into function calls for general
maintainability, refactorability, merge-conflict-avoidance, etc.
Merge pull request #72 from ironcladlou/master-cmd-breakup

Merged by openshift-bot
Return invalid when repo not found for mapping

Return invalid error when attempting to create an ImageRepositoryMapping
and the specified ImageRepository can't be found.