auto create missing db, much restructuring, many fixes