Add init_db command
Restructure code
Add migrations
Fix migrations