Refactor rendering. Add support for opaque PNG/GIF.