Honor data-uri attribute to embed images

If the data-uri attribute is set, embed the images into the document using Base64 encoding. Also add convenience methods on block to hide this logic.

As part of this change, honor the imagesdir attribute, if set, as the prefix of the image target and iconsdir as the prefix of the icon target.