Swap insert_attribute_* implementations

Make sure their order is consistent with the order of declaration in
header file.

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1057 99668b35-9821-0410-8761-19e4c4f06640
Adjust comment output to avoid malformed documents.

Comment value can not contain the string "--" or end with "-". Since
comments do not support escaping, we're handling this by adding an extra
space after the first "-". A string of "-" thus turns into "- - - ...".

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1058 99668b35-9821-0410-8761-19e4c4f06640
tests: Add a test for printing comments that contain --

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1059 99668b35-9821-0410-8761-19e4c4f06640