More robust error handling for .dm command

Enhanced .dm to detect several error situations and issue error message
rather than terminating with Python stack trace:
(1) .dm without a macro name
(2) missing .dm- (either hit another .dm or end-of-file)