[Work in progress] Add upstream changes and overhaul where possible

This is very much a work in progress at the moment, and I'm just creating the PR to make it easier for me to keep track of Travis results.

I have a few goals for this branch:

1.  Pull in changes from Mozilla's upstream code.  There aren't as many as I had initially expected but there are some.
2.  Improve PEP8 compliance all over the place.  The previous maintainers tried to keep variable names identical to the C code, presumably to ease the comparison with the Mozilla code, but we're going to be diverging from upstream after pulling in the changes mentioned in 1.  Basically, Mozilla seems very likely to abandon their character encoding detector in the near future and [switch to using ICU](https://bugzilla.mozilla.org/show_bug.cgi?id=724533), but ICU doesn't support all of the codecs we currently do, because it is more web-focused.  If our goal here is to be a truly universal character encoding detector, we'll need to go our own way in the future in that respect.
3.  Make the unit tests pass, or at the very least make it obvious that the tests are actually failing (instead of ignoring the failures like our current Travis build does).

So far, I've done a little bit of point 1 and updated the Travis testing setup to use nose and report test coverage via Coveralls.