Merge alloc.c inside cdb_make and other minor cleanups