Improve HTML Detection in History Support Middleware

Use built in ExpressJS methods for detecting HTML in the Accept header.