mesa: Rewrite the way uniforms are tracked and handled