Database Modified

Modified the database functions. Now at least addParent() and addChild()
work. More to come in a bit.
clean up