add support for resolving reference and data image URIs

- add convenience methods for creating reference URIs to images
  relative to the asset dirs (imagesdir, iconsdir) (no disk access)
- add support for embedding images into the document when the data-uri
  attribute is set
- take extreme care to not allow access to ancestor directories when
  preparing to read an image from the filesystem