Refactoring and fixing of two issues:

* First click on entities#index showed hierarchy _and_ details views.
* Hierarchy was not correctly built (maybe because of wrong error raising on
  detected circle).