test: remove misc uses of window object to prepare for node interop
test: add machinery for testing from nodejs