[#6622] add license header
[#6865] sort categories on template and as added by JS