big cleanup and fixes ie8 and ie7 compatibility