rewrite nmkdModel, add nmkdPdfModel, add EditMode, sessions,