Adjust query fragment layout.

Start cleaning up tab listener.