Clean up wildcard code.

- Move references and pointers next to the type.
- Rename match_internal to MatchInternal.
- Remove duplicate NULL check on map in MatchCIDR.