Redis queue and some changes in MongoDB and tests

Tests are done.