Remove extraneous uuid package dependency
Move function to outer scope

Since the 'if' doesn't introduce a new scope, it's best if the function
is at the top level to stop any misunderstandings. This also stops
`grunt jshint` complaining too.
Merge pull request #42 from chilts/remove-duplicate-uuid-depdendency

Remove extraneous uuid package dependency
Merge pull request #43 from chilts/move-function-to-outer-scope

Move function to outer scope