Fixed bug that prevented the creation of db dir.
db interface nows supports ordering.
Changed some fields for compatibility reasons.
Fixed a variable.
Migrated orders module from mongo to sqlite.