improved options parsing
fixed memory managment in leveldb implementation