Better init of tool selection
Improve canvas support detection, do it earlier
IE compatibility

Apparently IE11 doesn't support a second argument to
Element.classList.toggle().