Add test framework

A modified test framework modified from leveldb's. Tested under Linux and Windows.