Add injecting of pills into the generated code

* Adds code to extract pill code into the templated code
* Not great abstractions about what pills to add, will improve this over time.