Added documentation strings to functions and some more documentation to test-pattern-files.