Add some functions

This adds the following functions:
- transform the code so that no function has instructions after it returns;
- decompose reactions with more than two reactants into simpler ones;
- introduce buffer reactions when postconditions are incompatible with preconditions.