Fix Issue #1165 allows extensions to be set by certain settings

PAGINATION_PATTERNS was hard coded so that all files had a ".html" extension. This fixes that and add a test to
ensure that the pagination code is not changing the filename incorrectly.