Cache hash

This PR caches all hashes and reverts the Symbol caching hack.


Speed is unchanged for this benchmark:

Before:
```
$ ./expand2
Expanding: ((y + x + z + w)^15 + w)*(y + x + z + w)^15
1516ms
number of terms: 6272
```
After
```
$ ./expand2
Expanding: ((y + x + z + w)^15 + w)*(y + x + z + w)^15
1518ms
number of terms: 6272
```

But things get faster for this benchmark:
Before:
```
$ ./expand1
Expanding: (y + x + z + w)^60
185ms
number of terms: 39711
```
After
```
$ ./expand1
Expanding: (y + x + z + w)^60
161ms
number of terms: 39711
```

As well as for this one:
Before:
```
$ ./expand3
Expanding: (z^x + x^y + y^x)^100
47ms
number of terms: 5151
```
After:
```
$ ./expand3
Expanding: (z^x + x^y + y^x)^100
43ms
number of terms: 5151
```