More refactoring work on the Pattern classes, as well as some documentation work; also introducing new file header comments