This patch addresses two issues:
1. Currently if a wrapped function returns a NULL value, a "NULL" command will be created in the Tcl interpreter. Calling this command will cause a segmentation fault. A very small part of this patch makes a change to not create the "NULL" command when returning a NULL object value.
2. The current implementation searches for class methods using a linear search. This can cause performance issues in wrappers for classes with many member functions. This patch adds a method hash table to classes and changes method name lookup to use the hash table instead of doing a linear search.
I've also added a Tcl run-time test for null_pointer to check for the unwanted "NULL" command.