Refactoring of Repository

Changed way of getting/setting resources to match #36 changes