Modular unit testing with Javascript