Use SortedSet instead of Set

`Set` are collections of unordered values with no duplicates.
So using `Set` doesn't guarantee that the order of the dependencies
is always the same, this might leads to issues in the cache layer
where we calculate an MD5 for the `cache_key` based on what
`#dependencies` returns.