Updated to use LevelDB for persistence