Made a single graphics replay initialization loop.

Combined checking for extensions and finding the handles of programs to cache into a single loop upon loading. Also cached programs that were linked only once and not deleted in the trace.
Merge pull request #416 from chihuahua/make1InitializeLoop

Made a single graphics replay initialization loop.