Moved prepare code to common handler

Added ability to change repo preferences file.
Merge pull request #59 from TimSimpsonR/repo-wizardry

Moved prepare code to common handler