Add support for multiple UVs and data driven texture loading. From myconid's patches. Fixes #1493 and fixes #1497.