Moved functions into separate folder

Functions are more or less finished scripts and should be separated from the rest. This also makes it easy to find your basic algorithms.

This also encourages the creation of completed functions rather than scripts (which are easier to show to Alex and easily given to other people and much more easily debugged).