Add test for texture upload size

Add a test for texImage2D and texSubImage2D upload size when uploading different elements or ImageData.

Includes some code cleanup in the texture tests.