Verify correct refcount & no scalars are leaked

Fixes gh-1
test all the functions
test for growth
release the buffer memory
it's all the same