Tons of bug fixes, no more compile errors

Renamed api.h to api.c so that it can be compiled by RobotC at once.
Next up: test the API functionality on the old robot.