Loads of improvements and sync-provider command, query moved to query-provider
Implemented local caching