Add cache support.

* Make it more testable and add basic tests.
* Add tox for testing in 2.6 and 2.7.
I like to add a version like ``>=x.x.x`` so that if something fails in the future you at least get a hint as to what version used to work