Extend context to able to take more sophisticated objects than just strings

This PR allows for the context query object to take in slightly more sophisticated configuration than just flags.