Port: Search.TopTermsRewrite

added PriorityQueue implementation to Support namespace. also, some
small fixes in fst classes