Move tcache handling from engine to video.c, where it belongs.