Created namespace/classes for query/reply

Also fixed a little bit the callback system