almost finished with init_db and initializations

sometimes it segfaults
change ec_malloc name to smalloc (safe)
create and move some stuff to a header file
renamed basic file
required changes in the makefile and ignore

also moved the initialization of a counter variable
in the right place