Fix integration test failing after minor change in test image (see e5b77b3f656)
Change the way JavaScript is executed before rendering, simplifies error handling (#26) and allows for use with drawHTML too