fix for IE (forEach doesn't work in IE). 

Also added urlencoding of title and the 'url' parameter to twitter.