Documentation for functions
Add main domains to list of permitted recipients
Skeleton validate function

Gradually fill this in, but needs to go after authentication and before
opening any further DB connections.