Fix ordering of revs and tags

Use a LinkedHashMap for revisions to preserve order
Use a TreeMap for tags to sort by tag name