Several improvements in design, safety and performance

That for now.
Next saving libass errors from callback into state, store header copy in state, change events storing and add code comments.
Must be `sizeof(uintptr_t)` because it's a type.