Balance parenthesis actor

Added an actor that always inserts a balancing parenthesis in the editor. Did some minor changes.