Add init_db to initialize DB.
A working version, lacks tests :(