Finished writing db tests, and db functions for scenario

still needs fixing function docValidator (renamed StringtoInt) and
refactor db files and spec, scale in few files