Optimize createHTMLContainer function

The module.createHTMLContainer function now accepts widget-specific and
page-specific attributes that should be merged into resulting element
attributes.