Add pause and support for high resolution displays (devicePixelRatio > 1), refactoring