Remove most old browser detection by using more compatible code.

* createTextNode instead of textContent
* setAttribute for button type
* querySelector instead of getElementsByClassName