partial rewrite of key/value format to work with raw values for faster inserts
start adding basic tests