Add tests and small improvements for config.xml related features

Added tests for everything new implemented for #962.
And improved the getting of a config token before joining to reduce the number
of API calls when possible (if nothing was set in the room options or if the
XML generated is equal the default XML).

refs #962