cleaned up ie8 indexOf shim to conform to mathquill style