Add support for inline schema declaration

also add support for legend helper and extract parts of the forms template into separate templates.