Refactor pause and resume extensions to use viewports module