Added sprite (embedded images) support.
Code reorganization. Removed unused code in qjson.