Extracted browser sniffing and moderniser tests to a reusable template so that do not need to use layout.