add schema for database
split functions and config out
add database create
replace csv with json