Fix bugs with designate generation and refactor

Fix standalone designate generation.  Improve code structure slightly and refactor tests to use XmlTester.  Make the tests check the complete xpath.

Signed-off-by David Jencks <david_jencks@yahoo.com>