Time functions moved into scalar functions.
Updated to allow for sql folder.