Update remotemediator.js

I think this is more readable, so I tried it in jsperf and it's slightly faster too! http://jsperf.com/for-vs-split-search-string