Rework ext.categoryTree.js

* Remove unnecessary variable categoryTree
* Escape messages
* Replace deprecated .success() and .error() by .done() and .fail()

Change-Id: I07649b820de096ad81fcaae3812dc41bbc942e8c
Merge "Rework ext.categoryTree.js"