Added conditions in duplicate merging to avoid calling methods on nil.
Added rake task for merging duplicate orphaned works. Merges with accepted and unaccepted works.