try to more consistently handle URI-encoded URLs

- use document.URL where possible as it's more consistently URI-encoded
  across different browsers (e.g. Safari 5.1)
- for HTML4 browsers, assume the URI passed to pushState() is URI-encoded,
  and make sure that every character is encoded like document.URL
- fix a spelling mistake in the unsupport-fragment error
s/fragement/fragment/g in history.html4.js
provide a consistent URI-encoded document.location.href

Different browsers handle document.location.href and document.URL
in inconsistent ways.  Provide a new History.getLocationHref()
function to provide a consistently URI-encoded href
From current draft .. referring ti pushState and replaceState ...
"
4. If the third argument is present, set the document's current address to the absolute URL that was found earlier in this algorithm.

Since this is neither a navigation of the browsing context nor a history traversal, it does not cause a hashchange event to be fired.
"
I believe that " this is not a navigation" also applies to popState (as this this cause applies to push push and replace state)

The changes to history.js bring statechange (event) in line with the spec.
Was too aggressive in "was_expected"
Fix safari poll timing bug during pushState

If a pushState has just occurred and the Safari poller checks to see
if the hash has changed before the hashchange propagates, then it
sees the new state as being different from the actual state, thus
triggering a pushState. This patch sets a flag (waitForPropagation)
which is cleared by an interval after the hashchange finally
propagates.

The question.. what happens if a second pushState occurs before
the hashchange propagates?
add guard for pushState occurring while already waiting for propagation
fix storeState and getIdByUrl for Safari 5.0.x

History.storeState was only updating the urlToId mapping when new states
were stored during the session, and then updating the idToState and
stateToId mappings on unload, so when the safariStatePoll attempted
to check if the current state was the lastSavedState, that function's
dependency on extractState would fail as it was using the idToState
mapping.
HTML4: handle escaped/unescape versions of URLs consistently

When comparing hashes in HTML4 browsers, always compare fully
escaped versions of the hash (via encodeURIComponent).

In cases where an escaped URL was being pushed, HTML4 browsers would
fail to trigger a statechange event because a completely escaped URL
would fail to compare properly to a partially escaped URL.  That would
lead to a second pushState() of the same URL, leading to a no-op.

https://github.com/balupton/history.js/pull/108#issuecomment-3443739
fixed an issue in Safari's Private Browsing mode where setItem throws an exception
a dojo 1.7 based adapter for history.js.  I can't get buildr to install on the command line in Ubuntu, and requiring, node, npm, coffeescript and a handful other dependencies to build a simple client-side library is ridiculous - so I've made the changes that are needed to do the build with buildr. (AFAICT) they should work, but I haven't tested them. I manually built by catting the files together and using the built-in test scripts.
Merge remote-tracking branch 'remotes/drd/master'
Merge remote-tracking branch 'remotes/lakinwecker/master'
Merge remote-tracking branch 'remotes/hrunting/encoded-uris'
Merge remote-tracking branch 'remotes/jayphelps/master'
Merge remote-tracking branch 'remotes/rroesler/master'