revset: add helper function to get revset parse tree depth

Will be used to determine if a hgweb search query actually uses
any revset syntax.
revset: add helper function to get functions used in a revset parse tree

Will be used to determine whether all functions used in a hgweb search query
are allowed there.
revset: add a whitelist of DoS-safe symbols

'Safe' here means that they can't be used for a DoS attack for any given input.
hgweb: add revset syntax support to search

This mode is used when all the conditions are met:
- 'reverse(%s)' % query string can be parsed to a revset tree
- this tree has depth more than two, i.e. the query has some part of
revset syntax used
- the repo can be actually matched against this tree, i.e. it has only existent
function/operators and revisions/tags/bookmarks specified are correct
- no revset regexes are used in the query (strings which start with 're:')
- only functions explicitly marked as safe in revset.py are used in the query

Add several new tests for different parsing conditions and exception handling.
util.h: add stdint basic type definitions

MS C compiler v15 doesn't have stdint.h. Add basic int types those are defined
in stdint.h.