Faster CSE

Here is a proposal for a faster CSE.

For small expressions the CSE computation time is the same, but there is a huge improvement on large expressions, e.g., http://nbviewer.ipython.org/5986996.

I've let previous cse function, as prev_cse(), inside the file for easier compare.

I plan to do some comments on code in this PR tomorrow, explaining some decisions and asking for some help.