Added a unified content injection API.

Controllers can now call this.inject() with various options. Also added
tests.