Added base class for keyvalue test (wip)
Renamed test files to allow auto-collect from py.test
Added a bunch of new tests.
Fixed a few things discovered from the tests