Add preliminary Retina/High DPI display support.

* Adapted from http://www.html5rocks.com/en/tutorials/canvas/hidpi/