Add a number of fixes and updates to the department admin area and added command to rebuild the department tree.