Frame index

This PR fixes a bug on fast machines.

Previously, the time was used as a marker in the WebGL texture cache to delineate textures used in different frames. However, it is occasionally possible on fast machines that two frames will have the same time. This patch works around the problem by using a unique frame index, instead of the frame time, to delineate frames in the WebGL texture cache.