Simplify Viewport code and remove dojo/window dependency.