add support for getMethods() and added invokeMethod() function