Improvements to C implementation

I've made the C implementation considerably more efficient and tightened up the exposed C API.  I've also regenerated the search trees for all three implementations from the latest official list.

This also includes some improvements made earlier this year by ratelle.