small fixes for tests

clear cling (if enabled)
clear text (if already inputted)
go to correct panel (in case its out of order)
Added new unit test and vastly improved parentheses resolution