[bug 847752] Fix ua parser

* fix a couple of edge cases in the parser so it's more resilient
* change parser so it returns None for browser_version rather than
  0.0.0. None is what we use to denote that we couldn't parse
  anything useful.
* add test cases for issues fixed
* add some docs including a note about how this function should
  never throw an exception and if it does, that's a bug
* minor pep-8 stuff

r?