minor refactor to use callback selectItems

Did some minor refactoring so that Ovid uses callback instead of synchronous selectItems. Didn't want to refactor too much since there were no test cases.
`encodeURIComponent` when appending to URLs