refactor(main): functionize
test(normalize-dir): add normalize-dir test