Comment and other cleanup.
Use alternative to window.location.assign() for devices that don't support it
Add URL navigation workarounds for Samsung D8000

Found the following inconsistencies with the Samsung D8000 DOM API:
- window.location.href does not include the hash. Other devices do.
- window.location.assign() function does not exist

Workarounds added:
- When location.href doesn't appear to contain the hash, append it
- Where location.assign() doesn't exist, set location.href to the
  target URL instead

Unit tests have been added to check the behaviour works.
Rename application.exit() to application.back()

application.exit() is now the same as device.exit().
application.back() returns to the previous application, or exits
if there is none.
Add application.canGoBack() function and tests

This function returns a Boolean to indicate  whether calling application.back()
will return to a parent TAL app (True) or simply exit (False).
Trim history URLs to 1000 characters

Anecdotally, some devices have a de facto URL length limit of 1000 characters
(including hash).
When navigating forwards, trim the URL to this length by dropping the oldest
history elements.