Working with partials, avoid infite loops

We took out modifications of 'val' inside watch function for 'val'
which resulted in infite loops (which were gracefully treated by
angular until now, but it was still bad). In place, we put the
corresponding variables to the scope.

We put the node and leaf html snippets in partials. To load this
partials, we use ng-include snippets at runtime (they are hard
coded in js, which will still changes), which are global to
the directive module.