Adding functions.py, and proper versions of other files.