Cleaned up DBStoreTest and Pin

Improved style and comments. Also added some deeper testing
functionality to some DBStoreTest methods.