Improve degree calculation

The latest edition of SymPy's degree computation gives few undesired answers.

Example:

```
>>> degree(S.Pi)
1
>>> degree(S.GoldenRatio)
1
>>> f = (x**3-1)/(x-1)
>>> f
 3    
x  - 1
──────
x - 1 
>>> degree(f)
3
>>> degree(f,x)
ends up with a Polynomial error.
```

This commit would rectify above issues.