Adding support for high-DPI displays

See this for more info: http://www.html5rocks.com/en/tutorials/canvas/hidpi/
merging rhoot-high-dpi-support