More work porting algorithms to C
Finishes up spike