Switching javascript trims to jquery trims to help appease IE8.

Change-Id: I190b6a8d907db1186b0553551d83f039bdcd4665