better co_obj alloc/cleanup, remove globals
Merge branch 'r1-improvements' into dont-remove-local