Moved Repository out of core so it can be used to abstract over different implementations.