Allow users define custom functions

My limited understanding of the Activate under the hood and some free time over the weekend resulted in this pull request. The idea is to allow users define context specific query functions and operators. 

@fwbrasil could you please review and let me know what you think? Is this a worthwhile approach? Should I extend it to allow custom operators?