Text this: Mathematical basis and toolchain for hierarchical optimization of biochemical networks.