Clean up texture tests

texImage2D canvas test is refactored to reduce code duplication a bit.
Dead code and incorrect comments are fixed.
Add test for texture upload size

The test checks that the texture size is set correctly when an ImageData
object, an img, canvas, or video element is uploaded using texImage2D or
texSubImage2D. In the absence of getTexLevelParameter, the checking is
done by calling texSubImage2D near the coordinates of the texture's
bottom right corner and verifying that the GL error is set according to
whether it hits the inside or the outside of the texture.

The test verifies that setting the width and height attributes of
elements will affect the upload size of img elements which contain an
SVG image and also canvas elements, but don't affect the upload
size of bitmap img elements or video elements.
Merge pull request #516 from NVIDIA/teximage2d-dimensions-test

Add test for texture upload size