Generate "interface functions" for all methods, optimize linking (remove unused functions).