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).
I'd prefer testing that `WARNING != ERROR` and then here that `expected["type"] = Validation.MESSAGE_TYPES.WARNING` rather than having the test "know" what the constant's internal repr is.