Added joi validation to manifest.

Fixes #1722

Added Joi schema validation for `compose`. I tried to reuse existing schemas whenever possible.