Only put those uniforms to uniformsList which are in the program

Also cache uniform locations in the uniformsList, so that querying them
from the program is not needed. This reduces CPU usage.