Add Query function, max and min macros and NOT_FOUND_MINE and FOUND_MINE constants