generifying some of the foreign object caching util stuff into macros. works well. planned to use it for reusing event objects, but that might prove tricky without event_self_cbarg (available in libevent alpha, but not stable...) so screw it for now.