Add test-tap npm script that outputs TAP results to a separate file.

Fixes #1946.