store join parts in a tree
generate the association hash from the top down

This prevents us from walking back up the parent tree once for each
leaf.
do not convert the tree to a list just for the first node
walk the tree rather than generating a hash and walking it
rename the variable to make more sense with a tree
Add documentation for after_touch [ci skip]
reduce number of comparisons and array allocations

Just inspecting the children nodes will reduce the number of comparisons
we have to do (since it is limited to the child size)
parent is guaranteed to be the same

since we are searching a tree, the current level should be consistent,
so we don't have to inspect the parent class / table
we do not need to to_s the name all the time
we will always detect the same node, so just pass the node in
eliminate function that is only used in one place
names are guaranteed to be symbols
Fix the indentation
Move define_readers to class method since it doesn't need nothing from
the instance
Move define_writers to class level since we don't need anything from the
instance
Move define_constructors to class level
Move add_counter_cache_methods to class level
Use the reflection name instead of the accessor
Push define_accessors to class level since we don't need anythig from
the instance
:scissors: