Problem: free_fn and dup_fn API is inconsistent

Solution: remove free_fn from constructor and add explicit methods
to set free_fn and dup_fn on container. This makes the API look more
regular and simpler if you don't use these hooks.