core/alphabetDirectories.js: Refactored functions to return only once
test/core/alphabetDirectories.test.js: Refactored test to use stubs/spies for external dependencies
test/db/db-utils.test.js: Refcatored tests to create state inside the before hooks because it affected other tests