add support for multiple attributes on elements, fix for issue #7

Attempting to add multiple attributes to the same element was causing an Exception, and it was not possible as per issue #7 to add attributes to the top level element.  This pull request fixes both issues and updates the unit test with attributes to exercise those code paths.  All other unit tests pass.