Minor optimizations

- Changing `array.each()` to use a `for` loop instead of a `while` based on http://jsperf.com/array-foreach/2
- Refactored `utility.$()` to have a better decision tree and less wasted ops
- Leveraged closure scope for `element.val()` where applicable