Add support for c api testing

I'm not sure if this is needed or not but I figured I would see. I noticed the other day that there was no way to test str_to_cstr. This adds support for compiling/linking c source in test/t into the test binary. I've added an example for str_to_cstr.