Add option to sort in both directions

Fix license headers in files.