Major query interface changes

Changed the query interface.

Not implemented yet:
- AND/OR in queries

FYI:
Before upload to server. Check for correct address and port.