Cancellation of quadratic forms over commutative rings