IE11 support for 1.7

This is mainly just a backport of the 1.8 changes for IE11 support.