Move functions to external file.
Added functions.scm for math stuff.