Use plain javascript for manipulating dom in tests
Fix text node matching