Simplify surd by removing square factors (#274)