Added support for arbitrary field discovery and implemented more sophisticated query schema features.