move query types to specific plugins; support schemas per tenant; clean up dependencies