added pn_record_t
use records to provide more flexible contexts
fixed refcounting semantics to allow navigation from parent to child without reference cycles