Split image code out into separate module.
Moved other util funcs into util module.
Added simplex image generation.