correct code style for term module.
add self_and_ancestors_list method to Term class and unit test.