First cut at a C implementation of some of the easier functions.