Added fullscreen shortcut and refactored javascript for better modal handling