Add basic repo handling code and tests