less brittle jsdom cleanup. closes #4