[Browser test] Update to use new text styling menu

Also removed some duplicated code and
added test cases for bold and italic styling.

Change-Id: I181c208dd1165ea52bd4c49eb00c2eaae41ef05f