My attempt at a simple IoC implementation