clean up data.py
- [x] remove `isinstance(x, str)` checks
- [x] handle urls with context managers
- [x] get rid of `Exception` and use appropriate exception types
- [x] pep8
- [x] remove redundant parens in conditionals
- [x] remove `\` style line joins
- [x] `range` -> `xrange`
- [x] functions should not exit after a warning with `None` they should raise an exception
- [x] turn all the str `+` style concats into format strings
- [x] remove redundant calls to `str`
- [x] remove exception handlers with no exception type
- [x] replace calls to `__setattr__` and `__getattribute__` with `setattr` and `getattr`
- [x] code coverage at 99%

This should remove the connection reset by peer testing error and I thought I would perform a little housekeeping while I was at it.
