Refactored the code to mongodb, xively and qod packages.