Some bugfixes and more tests for JSON/XML REST writers

JSONRestWriter and XMLRestWriter now perform the same test cases
(expect for a few additional cases on either side for writer
specific option switches) and expect the same behavior:
- if a test case is expected to return a valid result for one
writer, it is also expected for the other writer and vice versa.
- if a test case is expected to throw an exception for one
writer, the same exception should be thrown for the other.

Several bugfixes to the writers were necessary to achieve that.

Change-Id: I28db15a2d20c7400c0dbafccb609c1e1f52f242a
Signed-off-by: Michael Ochmann <michael.ochmann@sap.com>