Name variable "node" rather than "widget" since children can be plain DOM nodes too.
Also simplify code in removeChild().
 Cleanup API comments and convert to JSDoc.
minor fixes