Thrift IDL updated, lookup details are now provided in a "Query" struct.

This allows for more flexible changes, and will stop the "lookup" function arguments
ballooning any further. Added stubs for features to come.
Adjusting code to support Query struct, adding support for excludes.

This makes the source compatible with the IDL change. This also adds support for supplying
exclusion patterns. If any exclusion patterns are hit, the item will be excluded from the
results.