Refactored stuff, added nedb.