changes for ffi-yajl
misc cleanup with helpers