added new code for async.waterfall and some generic mongodb,mysql functions