Split repository from packages

Moved add_REPO kind of function to its own file that is sourced by
packages, this way we can provide meaningful add_REPO functions.