Introduce validation method and class in XBlock API

@cpennington and @dmitchell please review

You can see the Studio extension of the Validation class in common/lib/xmodule/xmodule/validation.py in https://github.com/edx/edx-platform/pull/5710 (which is still WIP so is not yet commented or tested).
This structure seems a bit odd to me. Would you end up with something more clear by having a basic `Validation` class, that accepts any subclass of `ValidationMessage`? `ValidationMessage` could then check the allowed set of messages levels, and `StudioValidationMessage` could add extra attributes. `ValidationMessage` and subclasses could define a `to_json` that's used in the `Validation.to_json` function.

That seems to localize the understanding of a valid `StudioValidationMethod` to that objects constructor, and would even allow you to require more data for a `StudioValidationMethod`, while still keeping the `Validation` class simple.