html5Mode support.

Open for discussion.  This pull request enables use of html5Mode.  This should also still work with html5Mode(false).