Merge https://github.com/behdad/fonttools

Merge new changes from the above repository. It contains some essential
bugfixes.