Refactored test function logic.
Moved prettyDate to its own file.