Refactored write method so it accepts an IO object, not just a path.
Corrected issue in data-url formatting.
Built basic stylesheet emebedding.
Added some error handling to resource loading.
Implemented trivial case of image handling.