Query widget

Not quite ready for merge yet. Need to make a few more changes
change `unicode` -> `six.text_type`