Qt 5 compilation fixes.
Many changes to documentation, separate documentation modules for templates.