Always return the dispose function

For the useable API, we always need to get a function back so that `unuse()`
works correctly.

Moved variable definitions to the top for cleanliness and better uglification.

All modern browsers support `document.head`. Use it and fallback to querying.