Refactored query generator, cleaned up faceted browsing interface