file sorting and merged free_examples and free_attributes in free_containers

As free_attributes and free_examples are similar,, they've been merged
(as the two struct in previous commit).
And to clarify the code, the functions have been sorted in alphabetical
order.