Adding wpd test and allowing for pdf preview of web version.  fixes #9106
Adding comments and refactoring to use better hash syntax and more accurate hash codes