Stop audio/video after closing the media pop-up. Fixes #149
Attach event listeners also to dynamically inserted elements. Fixes #150