Added tests that cover close to 100% of the code base. One branch can't be triggered and the other depends on a Node.js bug.