Gravar-mail: Mixed-integer nonlinear optimisation approach to coarse-graining biochemical networks