[WIP] Mapgen performance improvements

Fixes #8743 
Before, `filteredNames()` used searchFlags as an 'AND', i.e. "Find all names that meet all of the criteria"

`nameTypesFromFlags()` is basically doing an 'OR' instead: "Find all name types that match any one of the requested flags"

This seems like a bug.

I think it should be

    if ( (searchFlags & type) == searchFlags ) {