suppress a number of clang warnings from SWIG-generated code
removed unused Function::factory()
removed not needed headers (thanks to include-what-you-use)

and added 'static' in a few places