Added screenshot capture code, framebuffer reading API, and bug fixes.