make code more DRY + more secure by using tempdir
add Makefile
fix no output error due to modperl keeping state
add lookupdbm function + selftest