spiv: A few fixes for spiv.
spiv: A few fixes for spiv.

* The image is now cached, so rotation and resize is faster

* Cleaned the code a little

* Added debug level command line option

gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim