[WIP] Rewriting the Univariate Solver

This PR aims to rewrite a cleaner and robust univariate equation solver.