title: union arrays and keep order
body: <p>I have a bunch of arrays and I want to union them, lodash does that:</p>
  
  <pre><code>_.union(['a', 'c'], ['a','b', 'c'], ['b', 'z'], ['y']) // ["a", "c", "b", "z", "y"]
  </code></pre>
  
  <p>What I expect is my array to rearrange if required, i.e:</p>
  
  <ul>
  <li>First occurrence we have <code>['a', 'c']</code></li>
  <li>Second occurrence we have b after a so it should return <code>['a', 'b', 'c']</code></li>
  <li>Third occurrence we have z after b so it should return <code>['a', 'b', 'z', 'c']</code></li>
  <li>Fourth occurrence we have only y so it should be added at the end of the array <code>['a', 'b', 'z', 'c', 'y']</code></li>
  </ul>
  
  <p>I expect:</p>
  
  <pre><code>_.union(['a', 'c'], ['a','b', 'c'], ['b', 'z'], ['y']) // ['a', 'b', 'z', 'c', 'y']
  </code></pre>
  
  <p>I have</p>
  
  <pre><code>_.union(['a', 'c'], ['a','b', 'c'], ['b', 'z'], ['y']) // ["a", "c", "b", "z", "y"]
  </code></pre>
  
  <p>How could I achieve that?</p>
  
  <p><strong>Edit</strong>: Tweaked @Andy's fiddle, here's my final working version <kbd><a href="http://jsfiddle.net/z8nnqp50/4/" rel="nofollow">Demo</a></kbd></p>