Wrote function test programs

In an attempt to run the code in a simpler form, the scaleTo function
and related code have been ported to python, and also copied to a c
file.
Cleaned up api.c

Removed some comments