realign codebase

There have been many many little changes to the codebase during
the development of the mssql dialect that are no longer needed, as
well as missed imports of changes upstream. This realigns the
disperate trees, and fixes a few related bugs