Query logic refactoring and some other minor fixes

Cleanup refactoring in queryContext logic at mongoBackend to make easier knowledgue transference to @kzangeli 

Some references to old issues fixed in the process. In addition, added a dependency to a package, part of the solution of https://github.com/telefonicaid/fiware-orion/issues/316