improved database module

* moved creation of directory structure to new-method
* wrote some plain old documentation
* improved and added appropriate tests