Fixing headers, moved sdup to mem.c and renamed