Add sensible hash for fragments.

   Also switched self.resources to be an OrderedSet.