Optimal design of integrally gated CNT field-emission devices using a genetic algorithm