move useRepository function into repository, fix jslint errors
change map repository to use an array of repositories