Refactoring and improving performance (see strftimeNew.js)