Refactor some code common to GSUB and GPOS