Better test structure

While looking into Python 3 support, I noticed that almost all the tests were written in an ad-hoc manner at the bottom of `memcache.py`. This PR splits them out into a separate test file that can be run more easily, especially by CI builds.