Fixing some subtle bugs in utils.prepare_data.
Fixing some subtle bugs in utils.prepare_data.

Need to add tests for this nastiness!

uwdata/ipython-vega,vega/ipython-vega,uwdata/ipython-vega-lite,uwdata/ipython-vega-lite,uwdata/ipython-vega,uwdata/ipython-vega-lite,vega/ipyvega,vega/ipyvega,vega/ipyvega,uwdata/ipython-vega,vega/ipython-vega,vega/ipyvega,vega/ipython-vega