How to organize code?

I’m trying to write my own xsheet for Maya with PyQt. So far I’ve figured out how to make a rearrangable frame list UI, but I can’t figure out how to handle its interaction with Maya’s animation system. Because I’m using my own interpolation method, I have to come up with some way of storing weights for key breakdowns and inbetweens and sorting them so that they interpolate in the right sequence(s) from frame to frame. The attachment has what I have so far, including a SWIG wrapper for the interpolator that is so far only compiled on Linux. Can anyone help me with this?

xchart-01142014.zip (92.4 KB)