Recursive and iterative implementations of Category Tree SPA, uses AngularJS