Fix bug in computing singularities of algebraic curves.

There are several levels of bugs involved in computing
singularities of algebraic curves. First, cacheing was
preventing puiseux from returning non-empty "pis" output.
Then, valuation had incorrect output due to the wrong
combination of simplify, expand, and collect statements.