lib-dom: Get rid of .construct() methods.
(cherry picked from commit abeae09)