Update documentation
Move source functions into own file