cleanup JS memory for blocks, closes #44