Add trimLeft and trimRight implementations to keep IE happy