Fixed incorrect datatype conversion on multi-indexes

When creating a new table from a `pandas` dataframe with a multi-index, the code would iterate over the index columns backwards but use their types as if counting forwards.  This meant that the created table had incorrect indexes for multi-indexes.

This code factors out a function to pull column names and column types for both SQLAlchemy and legacy table objects.  This code now iterates over the indices properly.

And additional test has been written.  All test pass on my local machine.

Closes https://github.com/pydata/pandas/issues/8021 .
Yes, that seems like a good idea.  However, to my surprise, `assert_frame_equal` does not catch differences in the datatypes of a multi-index.  This is because `assert_frame_equal` does not check the dtypes of the individual levels but only the overall index.  If both dataframes use multi-indexes, then the dtype of the index is simply `object` for both.  
This seems like it should be fixed by comparing the dtype of each level.  Should I submit a patch for this as a separate pull-request?