Exposed constructor functions

This PR refactors the content of constructor functions into init functions on the prototype of constructors, following #12833. 

This PR may not be accepted as-is, because it contains a change to the Tooltip/Popover API, leaving out the first string argument for type. I expect to roll that back to avoid backward-incompatible changes, but I wanted to first demonstrate a consistent init() API.