fix bugs in alloc & dealloc, simplify lookup, and remove unneeded declarations
simplify
remove DEVBUF references