Query now returns the messages asked for
Now using json.dumps and loads to do better queries from python. C++ is still a pain though.