First version with references
Added some tests that use leveldb
LevelDB backend mostly working, but needs major refactoring