Issue 3402

@phtaylor viewport callbacks + refactoring
I'm just trying to figure out when we wouldn't swap buffers here, and why is this now controlled by the viewport? Isn't it an 'application' setting?