Various python 3.x compatibility fixes

- Moved into a 1-file package so that `rgb.txt` can be included easily.
- Various python 3.x compatibility fixes. Tests pass in both python 2.x and 3.x.