C API fixes, additional tests, stackless rendering

This pull request contains

* several fixes to the C API functions
* a lot of additional C API tests
* stackless HTML rendering