There was a pretty major problem where the representation format used
column major accessing whereas I had assumed row major. Fixed it so now
things are being rendered the right way up. I also made incidental
improvements to PixelUtils and fixed the exports for gradient.