Speed up initial database creation
ported init_db to javascript