Integrating Jasmine JS testing and factored JS code