Adopt a reference-counting system to simplify use of the core library from API bindings in languages with automatic memory management.