Rewrite _map_cache to avoid np.in1d and where.

The resulting code appears to just disappear from the profiles.

Also take the opportunity to refactor slightly so that extruded is no
longer a special case in boundary map construction.

This doesn't currently touch the subsetting code, which appears to be a non-trivial cost for smaller problems. (For larger problems everything gets swallowed by sparsity construction!)