Add injector tests (and code that passes them)

This adds more injector tests and corrects several small things to make
them run.

key factory was given a method to return its type calculator, when a key
factory is used, it is important to use the same type calculator.