Added test code for named semaphores and moved to use of directive_failed family of macros to produce better checks and diagnostic messages.