Added tests for DomainMetadata and QueryExecutor services and adapters. Plus minor changes in logic.