FunctionTemplateDecls don't get registered in the lookup.
They have templated decls which are the ones that need to be reverted.
Move template handling functions in a separate 'section'
Style.
Simplify the update of the lookup tables when visiting a redeclarable.

The key idea is that the decl that is being detached from the redecl chain can
be in registered in the lookup tables. In this case we need to check if there
is another decl in the chain and update the lookup table so that the existing
decls in the chain could be accessible.
Simplify the removeIfLast. This soon will disappear.

In the past we used that routine as sanity check whether we are reverting in
the correct order. Now we have store/compare state.

Moreover this is wrong because the the template specializations create a mess
in the order, because the pattern is being added to the context but not the
underlying declarations. This breaks the logic of the visitor as it needs to have
two completely different code paths for templates and the rest of the decls only
because we wanted to keep this logic.

Now is a lot simpler. Remove the decl if it was in the context, without providing
any sanity checks what so ever.
If the lookup vector doesn't contain decls remove the entry from the map.

The lookup table is highly optimized: a single data member can be a single decl
or a vector with decls. In the regular case when clang only adds declarations
the single decl gets promoted to a vector.

The decl reverter doesn't bother to demote the vector into a single decl (for now)
Insted if we see the vector is empty we remove the lookup entry from the map and
thus we make the compareState happy.
Add handling for FunctionTemplateDecl-s and ClassTempalateDecls.

After the update of removeIfLast, they fall into the 'ordinary' cases.