Port lookup/refcount functionality from group table to gentables

Reviewer: @kenchiang 

These APIs allow callers to look up gentable entries by key without needing to maintain their own hashtable, by reusing the hashtable that already exists. Just like with the group table, the acquire/release functions allow code to store pointers to entry private data.