Set up the files so that the render function is a member of the object being rendered. Much tidier!