Refactor discovery code to use promises
Merge pull request #802 from remotestorage/promises-discover

Refactor discovery code to use promises