Take discover call out from depman.js and export it

So it can be used from the Depmanfile.js