Fixed to_cnf/to_dnf simplification

Havent added docstrings and tests.