Export persistance integration

Added tests for queries. 
Added export by queries.
Added tests for organizations
Added export by organization.