A general approach to the quantification of resin-bound functional groups by NMR