Fix resource deserialization
Resource serialization has been altered to improve what is put in the ES index
- arrays (only) when needed
- fields are fields and not always a new object
(from redmine: issue id 517, created on 2018-01-22tgradl, closed on 2018-08-17)
- Relations:
- relates #516