improved input validation and error handling on bad data

This fixes a data-loss issue that was was triggered by missing checks against/handling of  "bad" data. Such as failed attempts to deserialize arrays of objectives, learning materials and such from JSON-formatted user input.

See RM ticket 3202 for details.