Move Presentation Mode related code from viewer.js to its own file