Improve HTML Detection in History Support Middleware

Use built in ExpressJS methods for detecting HTML in the Accept header.
Merge pull request #1228 from jherdman/improve-html-detection-in-history-support

Improve HTML Detection in History Support Middleware