Add minor improvements to test framework and prepare for Class implementation.
Fix memory leak due to erroneous release call (#13).