Update encoding detection to spec, make the entire encoding detection case-insensitive (it is effectively in spec), and fix bug shown by the update in the encoding stream.
Update encoding detection to spec, make the entire encoding detection case-insensitive (it is effectively in spec), and fix bug shown by the update in the encoding stream.

dstufft/html5lib-python,gsnedders/html5lib-python,html5lib/html5lib-python,alex/html5lib-python,ordbogen/html5lib-python,mgilson/html5lib-python,gsnedders/html5lib-python,html5lib/html5lib-python,ordbogen/html5lib-python,alex/html5lib-python,ordbogen/html5lib-python,mgilson/html5lib-python,html5lib/html5lib-python,mindw/html5lib-python,dstufft/html5lib-python,mgilson/html5lib-python,dstufft/html5lib-python,mindw/html5lib-python,alex/html5lib-python,mindw/html5lib-python