MNT: Refactored query widget

Refactored widget now takes a nested dictionary as input to
construct the search boxes