refactor normalizeArray, improve performance

[test code](https://gist.github.com/dead-horse/ae3d6d34b6ec44d8d6ed)

before:

```
normalize simple path: 313ms
resolve simple path: 2098ms
normalize path contains .: 696ms
resolve path contains .: 2813ms
normalize path contains ..: 1043ms
resolve path contains ..: 3104ms
```

after:

```
normalize simple path: 307ms
resolve simple path: 860ms
normalize path contains .: 319ms
resolve path contains .: 926ms
normalize path contains ..: 457ms
resolve path contains ..: 1130ms
```
The `.reverse()` is costly. There a way you can get this out?