First pass at IE8 compatibility

First pass at IE8 compatibility. Will update after double checking original solution.