Prepare the screen orientation code to use the Blink impl

This is the first step to getting rid of our own custom extension
and be 100% compatible by the emerging standard.

This patch has been developed in cooperation with Mikhail Pozdnyakov!