Moved viewer-specific JS to viewer.js.