Add support for render context lost/restored events, initially with support for WebGL (thanks @mrcdk)