refactored collapsable tree to use require.js