Simpler parenthesis insertion code
Add tests for parenthesis insertion