Define ID for Intel HD 4000 on Lion. The GPU isn't actually used on any computer that shipped with Lion (hence it not being defined), but the check needs to work the same on both 10.7 and 10.8, of course.
Add lion subscripting categories.
Reduce state changes by keeping track of active program.

This was intended to fix issue #6, but ultimately didn't. But it still reduces the number of state changes, so I think it can stay.
Update global buffers by mapping their contents.

This apparently solved issue #6 (at least for me). It may be necessary to extend this to render parameter or bone transform buffers, too.