Add render context for multi-threaded renders

Some amendments to @csherratt's PR.

Closes #126