Restructure/rewrite of the Type1 font parser.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=852552