Refactor the metabook-repair code.

Pull code out of the CLI and create a new module for metabook-creation
and metabook-repair code.  Input metabook files don't necessarily
have to include the filerepo clauses (for instance); we will always
fetch those if missing.

This commit will help us pull the status reporting code out of the
CLI in the next patch set.

Change-Id: If3e2308ab3b3fab2294bcbe53371d94710a30cca