Fix invalid references

- Add more tests for to_html reference resolver

- Transform resource paths for media elements in to_html
 - //img/@src
 - //audio/@src
 - //video/@src
 - //object/@data
 - //object/embed/@src
 - //source/@src