Re-organised code into more coherent modules.
Added initial support for images for text widgets.
Added support for underlining text in text widgets.