Added slightly more detail to diagnose_frame option. This is helpful for debugging issues.
This adds some more error checking options for development, and simplifies the control flow checks which now become debug asserts.
Batching is mostly separated into a common template which can be used with multiple backends (GLES2 and GLES3 here). Only necessary specifics are in the backend files. Batching is extended to cover more primitives.