halfway there
use Writer in JSExecutor
a bit more
test passing (but a mess)
nearly there