tests for error handling and exceptions
add special case for ccc when it is used as a tail call
do not double-encode the exception
error handling functions implemented (but more testing still required)