Implement various arithmetic with Rationals

With this PR:
```
$ ./expand2 
Expanding: ((y + x + z + w)^15 + w)*(y + x + z + w)^15
1546ms
number of terms: 6272
```
So we even got a bit faster. I think the speed fluctuates.