tidy up
dont create globals during tests
deprecated renderHTML() in favour of toHTML(), and disabled external calls to render() - see #318