Refactor 'cmap' generation

Broken example: http://www.numark.jp/products/ns6/data/ns6_product_overview_JP_web.pdf

The current code is too inefficient to make the table size smaller than 64K.
Also fixes a potential problem in case the final startCode is already 0xFFFF.