Remove some implementation-specific functions/parts from repository.js. Remove the extend function from the repository's and relationships' prototypes; in the relationships service, use a 'normal' function instead.