Inversion of control for nodejs