A Modular Approach to the Design of Embedded Controllers for Chemical Reaction Networks