Game metaprogramming system for generating efficient search trees from high-level game metarules