Change InitLibrary to use InitGVarFuncsFromTable

This simplifies the code, and also avoids usage of the
low level NewFunctionC call.