Grade fixes

This pull request builds on the previous two, fixing bugs and improving performance for the Grade node, which is used to deliver the exposure and gamma controls in the 2d viewer. Only the last 5 commits are unique to this pull request.