MDL-40648 Added useful functions find_button() and count_button_rows()
MDL-40648 use parent functions
MDL-40648 Make sure the button is added in the correct row

previously code expected to find the button in particular row but the tinymce setting may change the buttons' layout