Unify naming of maximum length/count defines
Release correct reference type if string reserve fails
Just free the string object if adding it to the object tables fails

This matches the common pattern.
Add option to object_table_allocate_object to request an internal reference as well
Adapt to changed signature of event_remove_source function

Also use epoll based event loop.