Adds DB factory, and refactors the dir structure.
[core] Adds Timer to utils.