Apply viewport before rendering json or png. See GH-48.
Add 'viewport' support for render.html; apply viewport before downloading the content if viewport is not 'full'.