switch to py.test and fixes tests.
add values_to_names and names_to_values to enums
cache duplicate load

also ensure modules generated are same since they were dynamically
generated.
minor coding style refine
read from TMemoryBuffer object immediately after writing to it