Features/c api subscribers

Implements weak-refs using python c-api.