I don't like this this pattern. Pass jwcrypto as an argument to the constructor or (if you had an assertion module) as a parameter to module initialization. In general, this allows you stub out functionality for tests and reduces the likelihood of confusing side effects when you create objects.