Improve and expand getExtension test

Specification reads "getExtension Returns an object if, and only if, name
is an ASCII case-insensitive match [HTML] for one of the names returned
from getSupportedExtensions; otherwise, returns null." Chrome currently
doesn't behave this way, but rather has opted to not to have both
unprefixed and prefixed versions of the same extension in the list
returned by getSupportedExtensions. Test the spec-compliant behavior.

Also added minor formatting fixes and made the test deterministic.