For Slic3r, I recommend telling Slic3r that you have a RepRap printer not a Sailfish printer because somebody convinced them to use M108 for Sailfish and then use RepRap flavor in GPX.
The story with x3g is that it used to be s3g which is the 3rd Generation RepRap firmware protocol which MakerBot adopted and extended. It has some flaws such as that it isn't easily extensible in a backward compatible way.
But in many ways it is ahead of the gcode protocol that Marlin uses today. For one, it specifies precisely the framing, checksum and call response protocol. Marlin on the other hand just responds however it likes and often without even being asked a question which makes writing a host for it harder than it needs to be. It was written like it was intended for a human operator to type gcode directly into a terminal window and who cares about automating printing.
Good luck finding a g-code protocol specification. There's a wiki but it only talks about what g-code is supposed to do and precious little about the proper format of the responses.