Rewrote the connected texture framework and other stuff.