Bugfixes and daemon improvements. Persistance changed from sqlite to nedb