Use a common superclass for xcffib tests

In preparation for testing (and fixing) pack/synthetic, we hoist the common X
interaction bits of code out of test_python.py
Differentiate between cffi unpackers and memory unpackers

In order to create unions synthetically, the best API I can come up with is to
make people encode their data back to binary form, and let us unpack it as a
union (vs. making people specify it multiple times in various encodings). So,
we need the concept of a MemoryUnpacker for people who are interested in making
their own data in memory.
only resize when necessary

We should only resize the buffer when it is actually necessary, vs. all the
time. This is a problem when using MemoryUnpackers.
Add synthetic creation for unions
Add a pack() method for unions