Implement a better check for hidden values for %who etc.

From discussion in #4076, this uses a dictionary for hidden values instead of a set, and checks identity as well as name.

```
In [3]: e = 5

In [4]: f = 6

In [5]: %who
e	 f	 

In [6]: %whos
Variable   Type    Data/Info
----------------------------
e          int     5
f          int     6
```