Enforce ordering on tags.

Previously, tags were stored as a Set. Now they are stored as a List. This commit also allows Collections to be passed for some functions that previously required a more specific type.