Added some en situ gl state preserving code to vertex and index buffer classes.