support for ie < 9

In order to support ie8 we replaced instances of:
```javascript
Date.now
```
with
```javascript
(new Date()).getTime()
```
(see http://kangax.github.io/es5-compat-table/#Date.now)

and
```javascript
string.trim()
```
with
```javascript
string.replace(/^\s+|\s+$/g, '')
```
(see http://kangax.github.io/es5-compat-table/#String.prototype.trim)