Now uses the sortKey if available. Elements without a sortKey will always use name as fallback. Removed sort direction API again since it needs to be modeled case-by-case in the javascript anyway.