Factor out common security checks as includes.
Merge pull request #33 from willist/feature/security_checks

Factor out common security checks as includes.