Added to_nnf and test_to_nnf