Reorder util.extend logic
Merge pull request #152 from ryanseys/fix-extend

Reorder util.extend logic, fixing dead code