new optimization code
converted some test-main code to frame handlers; first step in generalizing texture handling
refactored texture handling in the engine