messy but working.
Start exposing the C API using a nice python dict, rather than offsets into an array.
This is much more convenient and allows a small amount of api skew without
serious problems. It also allows some safety checks to be performed during
import.
Mostly we just need to clean up the code a bit.