Improve text layout handling

TextLayout can now be created without a reference
to a canvas or context. Fixed drawing of text when
using an image builder. Added text drawing tests.