Refactoring validation

Validation has been completely refactored to be more organised, more efficient and to support explanation fields for URLs.

Sorry for the huge commit, you'll know it when you see it...