RUBY-636 Extracting query opts into its own hash