Completely rewrite CSS Image Tooltips

Tooltips now load asynchronously, and paths of all sorts are now handled correctly.
This code is now reused by HTML image tooltips, and base64 embedding.