Be strict about ModelType expected types.

This is a revised version of https://github.com/edx/XBlock/pull/27, with the serialize/deserialize code now living in edx-platform/xml_module, and strict error throwing in for_json methods.