Remove unrequired date validation requires
DRY up SpecialistDocument validators
Validate against Js in SpecialistDocument body
Don't pollute SpecialistDocument with errors and changes

No need to pollute the SpecialistDocument here with ActiveModel methods
these shouldn't be required here and should be the responsibility of the
validators.

This does however break the importer as we don't provide 'valid?' or
'errors' methods for the importer because we do not use the
SpecialistDocumentValidator. In order to solve this we use a
NullValidator to implement sensible defaults for these.
Use validator directly

When calling valid? in preview we end up with failures due to validation
errors being lost somewhere in the validation chain. Instead use the
validator directly which allows the errors hash to bubble up the chain
correctly.
If the body is invalid, render an error instead of the preview
Use pry-debugger to provide step functionality
Use rails-esque SafeHtmlValidator

Instead of using the govuk_content_models validator begin creating a validator which only validates specific fields in a more railsy way. This validator interacts directly with Govspeak::HtmlValidator driectly and only validates the html on specific fields. It means that our validator now only depends on the Govspeak gem and allows us to remove dependencies on ActiveModel::Dirty which the current gem validator expects. This is much more flexible.

We also remove the need for an SpecialistDocumentValidator to hide away the horrible hacks around 'valid?' and means that we no longer need to try DRY up the document validators and can instead explicitly validate fields for each document type.

This validator can eventually be pulled into the govuk_content_models gem and replace the SafeHtml validator there. We will not do this as part of this set of work in order to contain the large number of changes that would be required by other Gov.uk apps in order for this to work.
Merge pull request #198 from alphagov/bug/xss-preview-issue

XSS Preview Issue fix