Fix up the main file and add tests

junitdiff.js is now a library and a script, so you can use it either way. Also
added unit tests, which can be run with `node tests/all.js` from the main
directory.

Change-Id: Ic4b1acb8d87531076774e4383592bcc345424492