Import mocking and console output fixes from jsclass.