Update texture API to be more flexible

Now allows arbitrary binding of images to texture units instead of
requiring duplicate code work.

There are now less texture units so that it's not as wasteful to use a
flat array of used texture units when binding, bringing complexity from
O(n^2) to O(n). Not sure what to do about the binding happening every
time a new material shows up, or whether I should improve on the fact
that the code is located in update()...