Factor out class/function definitions into defs.js.
Add randomnized grid of gradients test page.