The design of optimum coded mask X-ray telescopes