REST: Marshalling and serialization

This pull request implements xp-framework/rfc#269 (and thereby fixes issue #306) by separating the serialization and marshalling responsibilities.

* Serialization is the act of transforming formats such as JSON and XML to data structures, and vice versa.
* Marshalling is the act of converting primitives, arrays and maps to complex objects, and vice versa.