Added safe version of global optimzations to be called during distribution. Can now compile policies w/ 4 seqs and 4 topo terms