added an init db feature
finished looking over everything. It needs a good test now.