Improve support for custom queries

Load Underscore as dependency to allow for easy extensions
Change custom partial function for the underscore one
Because of that, move the defaultStatisctics initialization to the beginning of checkRules