Fixes for namespacing bug, database creation

Namespacing bug was closure and algorithm issues, db creation scripts
include deletes, db test data scripts should be run separately after
creation