Added events and widgetFactory support

Also added the placeholder property (just an alias to
htmlOptions['placeholder'])