Promisify MemDb + moved memdb methods in threads

Added promisified versions of the memDb method into the memStore.js file
so these methods are now global and not just defined in the threads.js
pre file.