Basic implementation of scoped injection

This one includes another pull-request as well...